-
-
Notifications
You must be signed in to change notification settings - Fork 483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: locales not being included when srcDir has been changed #1964
fix: locales not being included when srcDir has been changed #1964
Conversation
src/layers.ts
Outdated
@@ -149,6 +149,6 @@ export const getLayerLangPaths = (nuxt: Nuxt) => { | |||
nuxt.options._layers | |||
.filter(layer => layer.config.i18n?.langDir != null) | |||
// @ts-ignore | |||
.map(layer => pathe.resolve(layer.config.rootDir, layer.config.i18n.langDir)) as string[] | |||
.map(layer => pathe.resolve(layer.config.rootDir, layer.config.srcDir, layer.config.i18n.langDir)) as string[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debugging this I found that layer.config.srcDir
already has layer.config.rootDir
included. So you should probably use:
pathe.resolve(layer.config.srcDir, layer.config.i18n.langDir)
But I'm not sure if I'm correct with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Messed up the copy&pase. I meant pathe.resolve(layer.config.srcDir, layer.config.i18n.langDir)
and updated my previous comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, it looks like srcDir
includes the absolute path, I thought it would use the configured value of srcDir
. But as seen here rootDir
is always part of srcDir
on _layers
https://github.com/nuxt/nuxt/blob/ae82d7089598bd1a4e5a8f88cd9edf7a1f12d7c7/packages/kit/src/loader/config.ts#L34
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nice catch. Thank you for checking this.
Adding |
aeb4234
to
3db7b52
Compare
That's a good point! I will test a custom |
π Linked issue
#1963
β Type of change
π Description
Resolves #1963
π Checklist